package net.sx.minemodule.mvp.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseModel;

import net.sx.minemodule.mvp.item.RefundArrayItem;

public class RefundArryBean extends BaseModel<RefundArrayItem> implements Parcelable {

    private String title;
    private String type;
    private boolean isSelected = false;

    public RefundArryBean() {

    }

    protected RefundArryBean(Parcel in) {
        title = in.readString();
        type = in.readString();
        isSelected = in.readByte() != 0;
    }

    public static final Creator<RefundArryBean> CREATOR = new Creator<RefundArryBean>() {
        @Override
        public RefundArryBean createFromParcel(Parcel in) {
            return new RefundArryBean(in);
        }

        @Override
        public RefundArryBean[] newArray(int size) {
            return new RefundArryBean[size];
        }
    };

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.title);
        dest.writeString(this.type);
        dest.writeByte(this.isSelected ? (byte) 1 : (byte) 0);
    }

    @Override
    public RefundArrayItem createItem(MultiTypeAdapter adapter) {
        return new RefundArrayItem(this, adapter);
    }
}
